package com.ynding.springboot.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
@Slf4j
@RabbitListener(queues = "queue1")
public class Topic1Receiver {

    @RabbitHandler
    public void handleMessage(String message, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
        log.info("Received Message:<{}>", message);
    }

}
